package cn.monkey.chat.server.connect;

import cn.monkey.io.transport.netty.server.ServerTransport;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Component
public class ServerRunner implements ApplicationRunner {

    final ServerTransport serverTransport;

    public ServerRunner(ServerTransport serverTransport) {
        this.serverTransport = serverTransport;
    }

    @Override
    public void run(ApplicationArguments args) throws Exception {
        serverTransport.start().block();
    }
}
